#!/bin/bash


DIRECTORIES=${*}
i=0

for directory in $DIRECTORIES
do
  echo "Processing directory $directory"
  for file in `ls ${directory}`
  do
    echo "Renaming ${file} to ${directory##*/}_${file}"
    mv ${directory}/${file} ${directory}/${directory##*/}_${file}
  done
done
